tools/libxl: Update datacopier to support sending data only
authorWen Congyang <wency@cn.fujitsu.com>
Mon, 16 Mar 2015 13:29:50 +0000 (13:29 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 18 Mar 2015 11:31:57 +0000 (11:31 +0000)
commit42ad92e656192a214888a9bd07125ded8b66bbc4
treeaa05b42ab1323546050270507a75adcce7114ae5
parent7057feebe117c64708aab054c5055e7a93341a0b
tools/libxl: Update datacopier to support sending data only

Currently, starting a datacopier requires a valid read and write fd, but this
is a problem when purely sending data from a local buffer to a writable fd.

The prefixdata mechanism already exists and works for inserting data from a
local buffer ahead of reading from the read fd.

Make the lack of a read fd non-fatal.  A datacopier with no read fd, but some
prefixdata will write the prefixdata to the write fd and complete successfully.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
[Rewrite commit message]
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_aoutils.c